package com.haogu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.haogu.entity.Task;
import com.haogu.entity.VRecord;
import com.haogu.entity.VTask;
import com.haogu.mapper.RecordMapper;
import com.haogu.service.RecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class RecordServiceImpl implements RecordService {
    @Resource
    private RecordMapper recordMapper;
    @Override
    public Map selectVRcordByPage(Integer pageNum, Integer pageSize) {

        Map map = new HashMap();
        //查询分页数据
        List<VRecord> vRecords = recordMapper.selectVRcordByPage((pageNum - 1) * pageSize, pageSize);
        //查询行数
//        QueryWrapper<Task> qw = new QueryWrapper<>();
//        qw.eq("delete_status",0);
        Integer integer = recordMapper.selectCount();
        //将数据放入map返回
        map.put("totalRows",integer);
        map.put("result",vRecords);
        Map map1 = new HashMap();
        map1.put("data",map);
        return map1;
    }
}
